import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';

export const columns: BasicColumn[] = [
    {
    title: '课程标识',
    dataIndex: 'courseId'
   },
   {
    title: '目录标识',
    dataIndex: 'catalogId'
   },
   {
    title: '问题',
    dataIndex: 'question'
   },
   {
    title: '问题类型:0:单选， 1:多选',
    dataIndex: 'questionType'
   },
   {
    title: '选择列表',
    dataIndex: 'answerList'
   },
   {
    title: '正确答案',
    dataIndex: 'rightAnswer'
   },
   {
    title: '排序',
    dataIndex: 'questionSort'
   },
];

export const searchFormSchema: FormSchema[] = [
 {
    label: '课程标识',
    field: 'courseId',
    component: 'Input'
  },
 {
    label: '目录标识',
    field: 'catalogId',
    component: 'Input'
  },
];

export const formSchema: FormSchema[] = [
  // TODO 主键隐藏字段，目前写死为ID
  {label: '', field: 'id', component: 'Input', show: false},
  {
    label: '课程标识',
    field: 'courseId',
    component: 'Input',
  },
  {
    label: '目录标识',
    field: 'catalogId',
    component: 'Input',
  },
  {
    label: '问题',
    field: 'question',
    component: 'Input',
  },
  {
    label: '问题类型:0:单选， 1:多选',
    field: 'questionType',
    component: 'Input',
  },
  {
    label: '选择列表',
    field: 'answerList',
    component: 'Input',
  },
  {
    label: '正确答案',
    field: 'rightAnswer',
    component: 'Input',
  },
  {
    label: '排序',
    field: 'questionSort',
    component: 'InputNumber',
  },
];
